﻿using System;
using System.Collections.Generic;
using mscook.core;
using mscook.core.domain;
using mscook.core.repositories;
namespace mscook.core.services
{

    public class ChefService : IChefService
    {
        private IChefRepository iChefRepository;

        public ChefService(IChefRepository iChefRepository)
        {
            this.iChefRepository = iChefRepository;
        }

        public Chef Get(string id)
        {
            return iChefRepository.Get(id);
        }

        public IList<Chef> SelectPageList(int start, int limit, out long total)
        {
            return iChefRepository.SelectPageList(start, limit, out total);
        }

        public bool Delete(string id)
        {
            return iChefRepository.Delete(id);
        }

        public void SaveOrUpdate(Chef Chef)
        {
            iChefRepository.SaveOrUpdate(Chef);
        }

        public IList<Chef> GetByKeyword(string keyword, int start, int limit, out long total)
        {
            return iChefRepository.GetByKeyword(keyword,start,limit,out total);
        }



        public IList<Chef> SelectListShowOnHome()
        {
            return iChefRepository.GetAll();
        }

        public IList<Chef> SelectLimitbyIds(IList<string> resourceIds, int start, int limit, out long total)
        {
            return iChefRepository.GetLimitByIds(resourceIds, start, limit, out total);
        }

        public IList<Chef> SelectPageList(int start, int limit, out long total, string chefName)
        {
            return iChefRepository.SelectPageList(start,limit,out total,chefName);
        }

        public IList<Chef> SelectPageListByExpressions(int start, int limit, out long total, System.Linq.Expressions.Expression<Func<Chef, bool>> expression)
        {
            return iChefRepository.SelectPageList(start, limit, out total, expression);
        }

            
    }
}
